using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using OneSoft.EntityCore;
using OneSoft.DataAccess;
using BySoft.Server.Common.Entity;
using BySoft.Server.Common.Schema;

namespace BySoft.Server.DataAccess
{
	public partial class BsBomchangedetailDA
	{
		#region GetByID

		/// <summary>
		/// 取得实体
		/// </summary>
		/// <param name="id">实体关键字</param>
		/// <returns></returns>
		public static BsBomchangedetailEntity GetBsBomchangedetailByID(Decimal? id)
		{
			string strSQL = "SELECT * FROM " + BsBomchangedetailTable.C_TABLENAME;
			WhereBuilder wb = new WhereBuilder(strSQL);
			wb.AddAndCondition(BsBomchangedetailTable.C_BOMCHANGEDETAILID, SQLOperator.Equal, id);
			return OneSoft.DataAccess.DataAccessCommon.SelectSingle<BsBomchangedetailEntity>(wb);
		}

		#endregion

		#region GetAll

		/// <summary>
		/// 获取所有数据
		/// </summary>
		/// <returns>所有数据集合</returns>
		public static DataSet GetBsBomchangedetailAll()
		{
			string strSQL = "SELECT * FROM " + BsBomchangedetailTable.C_TABLENAME;
			return OneSoft.DataAccess.DataAccessCommon.SelectDataSet(strSQL);
		}

		#endregion

		#region GetByCondition

		/// <summary>
		/// 根据Condition获取DS
		/// </summary>
		/// <returns>所有数据集合</returns>
		public static DataSet GetDSByCondition(string strCondition)
		{
			string strSQL = "SELECT * FROM " + BsBomchangedetailTable.C_TABLENAME;
			WhereBuilder wb = new WhereBuilder(strSQL);
			wb.AddCondition(strCondition);
			return OneSoft.DataAccess.DataAccessCommon.SelectDataSet(wb);
		}

		/// <summary>
		/// 根据Condition获取实体集合
		/// </summary>
		/// <param name="strCondition">SQL条件</param>
		/// <returns>实体集合</returns>
		public static List<BsBomchangedetailEntity> GetByCondition(string strCondition)
		{
			string strSQL = "SELECT * FROM " + BsBomchangedetailTable.C_TABLENAME;
			WhereBuilder wb = new WhereBuilder(strSQL);
			wb.AddCondition(strCondition);
			return OneSoft.DataAccess.DataAccessCommon.Select<BsBomchangedetailEntity>(wb);
		}

		#endregion
	}
}

